
from model.item import Item

class House(Item):
    def __init__(self, _dict): 
        #name, description, year, price, status, # BaseClass
        #style, nrooms, nbaths, ngarages, basement, lots, living_space=None,faces=None, deck=None, patio=None, fence=None, ac=None):
        """Arguments:
            style --- TINYINT 0:single, 1:semi detached, 2:town house, 3:banglo
            floor --- SMALLINT NULL,#0:hardwood, 2:carpet, 3:ceramic, 4:mixed, 5:others
        """
        Item.__init__(self, _dict)
        
        self.style = _dict['style']
        self.n_rooms = _dict['n_rooms']
        self.n_baths = _dict['n_baths']
        self.n_garages = _dict['n_garages']
        self.basement = _dict['basement']
        self.lots = _dict['lots']
        
        # optional fields
        self.living_space = _dict['living_space']
        self.faces = _dict['faces']
        self.deck = _dict['deck']
        self.patio = _dict['patio']
        self.fence = _dict['fence']
        self.ac = _dict['ac']

        # associate fields
        self.address = _dict['address']
        
if __name__ == '__main__':
    # create table
    #db.drop_all()
    #db.create_all()
    pass